@extends('admin.common.main')

@section('content')
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span
            class="c-gray en">&gt;</span> 用户管理 <a class="btn btn-success radius r"
                                                      style="line-height:1.6em;margin-top:3px"
                                                      href="javascript:location.replace(location.href);" title="刷新"><i
                class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="text-c">
            <input type="text" class="input-text" style="width:250px" placeholder="输入会员名称、电话、邮箱" id=""
                   name="">
            <button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户
            </button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="l"><a href="javascript:;" onclick="datadel()"
                                                                   class="btn btn-danger radius"><i
                        class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a href="{{route('admin.user.add')}}"
                                                                          class="btn btn-primary radius"><i
                        class="Hui-iconfont">&#xe600;</i> 添加用户</a></span> <span
                class="r">共有数据：<strong>88</strong> 条</span></div>
        <div class="mt-20">
            @include('admin.common.error')
            <table class="table table-border table-bordered table-hover table-bg table-sort">
                <thead>
                <tr class="text-c">
                    <th width="25"><input type="checkbox"></th>
                    <th width="20">ID</th>
                    <th width="100">用户名</th>
                    <th width="100">真实姓名</th>
                    <th width="90">手机</th>
                    <th width="150">邮箱</th>
                    <th width="30">性别</th>
                    <th width="130">加入时间</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $k=>$v)
                    <tr class="text-c">
                        @if(auth()->id() != $v['id'])
                            @if(!$v['deleted_at'])
                                <td><input type="checkbox" value="{{$v['id']}}" name="id[]"></td>
                            @else
                                <td></td>
                            @endif
                        @else
                            <td></td>
                        @endif
                        <td>{{$v['id']}}</td>
                        <td>{{$v['username']}}</td>
                        <td>{{$v['truename']}}</td>
                        <td>{{$v['phone']}}</td>
                        <td>{{$v['email']}}</td>
                        <td>@if($v['sex']==1)男@else女@endif</td>
                        <td>{{$v['created_at']}}</td>
                            <td class="f-14">
                                <a title="分配角色" href="{{route('admin.user.role',$v)}}" class="label label-warning radius">分配角色</a>
                                <a title="编辑" href="{{route('admin.user.edit',['id'=>$v->id])}}" class="label label-success radius" >编辑</a>
                                @if(auth()->id() != $v->id && $v['deleted_at'] == null)
                                    <a title="删除" href="{{route('admin.user.del',['id'=>$v->id])}}" class="label label-danger radius" >删除</a>
                                @elseif(auth()->id() != $v->id && $v['deleted_at'] != null)
                                    <a title="恢复" href="{{route('admin.user.restore',['id'=>$v->id])}}" class="label label-default radius" >恢复</a>
                                @endif
                            </td>
                    </tr>
                @endforeach
                </tbody>
            </table>

            {{$data->links()}}
        </div>

        @endsection

        @section('js')

@endsection
